
var htmlWebpackPlugin = require("html-webpack-plugin");
var path = require("path")
module.exports = {
	entry: {
		main: "./app/main.js"
	},
	output: {
		path: __dirname + "/public/",
		chunkFilename: 'hash',
		filename: "[name].js"
	},
	module: {
		rules: [
			{
        		test: /\.jpg$/,
        		use: [
          			{
            			loader: 'file-loader',
          			}
        		]
      		},
      		{
				test: /\.css$/,
		        use:  ["style-loader", "css-loader"]
		    }
		]
	},
	plugins: [
		new htmlWebpackPlugin()
	],
	devServer: {
		port: 8090,
		contentBase: path.join(__dirname, "public"),
		proxy: {
			'/api': 'http://localhost:3000',
		}
	},
	devtool: "source-map"//方便测试，定位异常


}